package com.jdbc_demo2.mapper;

import com.jdbc_demo2.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

//@Mapper表示该类是一个Mapper类，Mapper类中的方法会与数据库进行交互
@Mapper
public interface UserMapper {
    // 根据username和password查询表user3中的用户
    @Select("select * from user3 where username=#{username} and password=#{password}")
    User getUserByNameAndPassword(User user);
}